const Sequelize = require("sequelize");
const { dataBase, host, admin, dialect, pwd } = require("../config/dbConfig");

// 创建链接
const sequelize = new Sequelize(dataBase, admin, pwd, {
  host,
  dialect,
  logging: false
})

async function test() {
  try {
    await sequelize.authenticate();
    console.log('连接数据库成功');
  } catch (error) {
    console.error('Unable to connect to the database:', error);
  }
}
test()
module.exports = sequelize